<?php

namespace app\controllers;

use yii\web\Controller;

class HomeController extends Controller {
	public function actionIndex() {
		$stu = [ 
				'name' => 'xiaoming',
				'age' => 18,
				'sanwei' => [ 
						'xiongwei' => 60,
						'tunwei' => 90,
						'yaowei' => 80 
				] 
		];
		
		return $this->render ( 'index', $stu );
	}
	
	public function actionIndex2() {
		$stu = [
				'name' => 'xiaoming',
				'age' => 18,
			
		];
		$book=[
				'bname'=>'php',
		        'bprice'=>100
		];
		$arr=[
		'stu'=>$stu,
		'book'=>$book
		];
	
		return $this->render ( 'index2', $arr );
	}
	//3
	//return $this->render ( 'index2', compact('stu','book'));
   public function  actionIndex3(){
       $data=[
       		'name'=>'<html tom',
       		'like'=>'<script> alert("ccc");</script>'
       ];   
   	return  $this->render('index3',$data);
}
}